﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TB_CS.DingTalk
{
    public partial class DingTalk_Robt : Form
    {
        public DingTalk_Robt()
        {
            InitializeComponent();
        }

        private void DingTalk_Robt_Load(object sender, EventArgs e)
        {
            DataSet Robot_Type_DST = Class.SysInfo.WSDK.GET_ROBOT_TYPE_LIST();
            for(int i=0;i<Robot_Type_DST.Tables[0].Rows.Count;i++)
            {
                comboBox1.Items.Add(Robot_Type_DST.Tables[0].Rows[i][0].ToString()+"#"+Robot_Type_DST.Tables[0].Rows[i][1].ToString());
                
            }
            dataGridView1.DataSource = Class.SysInfo.WSDK.GET_ROBOT_URL(Convert.ToInt32(Class.SysInfo.INFO_Seller_ID)).Tables[0];
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Class.SysInfo.WSDK.INSERT_ROBOT_URL(Convert.ToInt32(comboBox1.Text.Trim().ToString().Split('#')[0].ToString()),
                textBox1.Text.Trim().ToString(), Convert.ToInt32(Class.SysInfo.INFO_Seller_ID.ToString()));
            textBox1.Text = "";
            dataGridView1.DataSource = Class.SysInfo.WSDK.GET_ROBOT_URL(Convert.ToInt32(Class.SysInfo.INFO_Seller_ID)).Tables[0];
            textBox1.Focus();
        }
    }
}
